import { useContext, useEffect, useState } from "react";
import type { IParams } from '@/interface/visitor'
import { GetVisitorList } from '@/api/visitor'
import { userContext } from '@/store/userContext';
import { useNavigate } from "react-router-dom";
interface IPageParams {
    page: string,
    pageSize: string
}
let getListParamDef:IParams = {  page: '1', pageSize: '10' }
const VisitorList = () => {
   const router = useNavigate()
    const context = useContext(userContext) as any
    const getList = async () => {
       const { data } = await GetVisitorList(getListParamDef)
       console.log('获取数据..', data)
    }
    const [pageParams, setPageParams] = useState<IPageParams>({
        page: '1',
        pageSize: '10'
    })
    return (<div className='VisitorList'>
    email: {context.email}
       page:{pageParams.page}
        VisitorList
        <button onClick={() => {
          setPageParams({...pageParams,  page: '2' })
        }}>切换分页</button>
    </div>);
}
export default VisitorList;
